import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/certificate_file_entity.dart';

CertificateFileEntity $CertificateFileEntityFromJson(Map<String, dynamic> json) {
  final CertificateFileEntity certificateFileEntity = CertificateFileEntity();
  final String? becomeDueDate = jsonConvert.convert<String>(json['becomeDueDate']);
  if (becomeDueDate != null) {
    certificateFileEntity.becomeDueDate = becomeDueDate;
  }
  final String? certificateBackUrl = jsonConvert.convert<String>(json['certificateBackUrl']);
  if (certificateBackUrl != null) {
    certificateFileEntity.certificateBackUrl = certificateBackUrl;
  }
  final String? certificateFrontUrl = jsonConvert.convert<String>(json['certificateFrontUrl']);
  if (certificateFrontUrl != null) {
    certificateFileEntity.certificateFrontUrl = certificateFrontUrl;
  }
  final String? certificateName = jsonConvert.convert<String>(json['certificateName']);
  if (certificateName != null) {
    certificateFileEntity.certificateName = certificateName;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    certificateFileEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    certificateFileEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    certificateFileEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    certificateFileEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    certificateFileEntity.deleted = deleted;
  }
  final int? fileChildType = jsonConvert.convert<int>(json['fileChildType']);
  if (fileChildType != null) {
    certificateFileEntity.fileChildType = fileChildType;
  }
  final String? fileConfigId = jsonConvert.convert<String>(json['fileConfigId']);
  if (fileConfigId != null) {
    certificateFileEntity.fileConfigId = fileConfigId;
  }
  final String? fileHistory = jsonConvert.convert<String>(json['fileHistory']);
  if (fileHistory != null) {
    certificateFileEntity.fileHistory = fileHistory;
  }
  final String? fileObject = jsonConvert.convert<String>(json['fileObject']);
  if (fileObject != null) {
    certificateFileEntity.fileObject = fileObject;
  }
  final String? fileObjectName = jsonConvert.convert<String>(json['fileObjectName']);
  if (fileObjectName != null) {
    certificateFileEntity.fileObjectName = fileObjectName;
  }
  final String? formId = jsonConvert.convert<String>(json['formId']);
  if (formId != null) {
    certificateFileEntity.formId = formId;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    certificateFileEntity.id = id;
  }
  final String? obtainDate = jsonConvert.convert<String>(json['obtainDate']);
  if (obtainDate != null) {
    certificateFileEntity.obtainDate = obtainDate;
  }
  final int? specialType = jsonConvert.convert<int>(json['specialType']);
  if (specialType != null) {
    certificateFileEntity.specialType = specialType;
  }
  final String? statusName = jsonConvert.convert<String>(json['statusName']);
  if (statusName != null) {
    certificateFileEntity.statusName = statusName;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    certificateFileEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    certificateFileEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    certificateFileEntity.updateDate = updateDate;
  }
  final String? workTypeId = jsonConvert.convert<String>(json['workTypeId']);
  if (workTypeId != null) {
    certificateFileEntity.workTypeId = workTypeId;
  }
  final String? specialWorks = jsonConvert.convert<String>(json['specialWorks']);
  if (specialWorks != null) {
    certificateFileEntity.specialWorks = specialWorks;
  }
  return certificateFileEntity;
}

Map<String, dynamic> $CertificateFileEntityToJson(CertificateFileEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['becomeDueDate'] = entity.becomeDueDate;
  data['certificateBackUrl'] = entity.certificateBackUrl;
  data['certificateFrontUrl'] = entity.certificateFrontUrl;
  data['certificateName'] = entity.certificateName;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['fileChildType'] = entity.fileChildType;
  data['fileConfigId'] = entity.fileConfigId;
  data['fileHistory'] = entity.fileHistory;
  data['fileObject'] = entity.fileObject;
  data['fileObjectName'] = entity.fileObjectName;
  data['formId'] = entity.formId;
  data['id'] = entity.id;
  data['obtainDate'] = entity.obtainDate;
  data['specialType'] = entity.specialType;
  data['statusName'] = entity.statusName;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['workTypeId'] = entity.workTypeId;
  data['specialWorks'] = entity.specialWorks;
  return data;
}

extension CertificateFileEntityExtension on CertificateFileEntity {
  CertificateFileEntity copyWith({
    String? becomeDueDate,
    String? certificateBackUrl,
    String? certificateFrontUrl,
    String? certificateName,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    int? fileChildType,
    String? fileConfigId,
    String? fileHistory,
    String? fileObject,
    String? fileObjectName,
    String? formId,
    String? id,
    String? obtainDate,
    int? specialType,
    String? statusName,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? workTypeId,
    String? specialWorks,
  }) {
    return CertificateFileEntity()
      ..becomeDueDate = becomeDueDate ?? this.becomeDueDate
      ..certificateBackUrl = certificateBackUrl ?? this.certificateBackUrl
      ..certificateFrontUrl = certificateFrontUrl ?? this.certificateFrontUrl
      ..certificateName = certificateName ?? this.certificateName
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..fileChildType = fileChildType ?? this.fileChildType
      ..fileConfigId = fileConfigId ?? this.fileConfigId
      ..fileHistory = fileHistory ?? this.fileHistory
      ..fileObject = fileObject ?? this.fileObject
      ..fileObjectName = fileObjectName ?? this.fileObjectName
      ..formId = formId ?? this.formId
      ..id = id ?? this.id
      ..obtainDate = obtainDate ?? this.obtainDate
      ..specialType = specialType ?? this.specialType
      ..statusName = statusName ?? this.statusName
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..workTypeId = workTypeId ?? this.workTypeId
      ..specialWorks = specialWorks ?? this.specialWorks;
  }
}
